package com.lkl.controller;

import com.lkl.entity.BaseResp;
import com.lkl.service.TgHotelService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (TgHotel)表控制层
 *
 * @author makejava
 * @since 2022-03-31 15:53:16
 */
@RestController
@RequestMapping("tgHotel")
public class TgHotelController {
    /**
     * 服务对象
     */
    @Resource
    private TgHotelService tgHotelService;


    @GetMapping("findAll")
    public BaseResp findAll() {
        return this.tgHotelService.findAll();
    }

    @GetMapping("findByName/{hotelName}")
    public BaseResp findByName(@PathVariable("hotelName") String hotelName) {
        return this.tgHotelService.findByName(hotelName);
    }

    @GetMapping("findHomeByIdAndHotelId/{hotelId}/{homeId}")
    public BaseResp findHomeByIdAndHotelId(@PathVariable("hotelId") Integer hotelId, @PathVariable Integer homeId) {
        return this.tgHotelService.findHomeByIdAndHotelId(hotelId, homeId);
    }

    @RequestMapping("updateHotelHomeNum/{homeId}/{num}")
    public BaseResp updateHotelHomeNum(@PathVariable Integer num, @PathVariable("homeId") Integer homeId) {
        return this.tgHotelService.updateHotelHomeNum(num, homeId);
    }

    @RequestMapping("updateHotelHomeStatus/{homeId}/{status}")
    public BaseResp updateHotelHomeStatus(@PathVariable Integer status, @PathVariable("homeId") Integer homeId) {
        return this.tgHotelService.updateHotelHomeStatus(status, homeId);
    }

    @RequestMapping("findHomeById/{homeId}")
    public BaseResp findHomeById(@PathVariable("homeId") Integer homeId) {
        return this.tgHotelService.findHomeById(homeId);
    }




}